class Solution(object):
    def toGoatLatin(self, sentence):
        """
        :type sentence: str
        :rtype: str
        """
        ans = []
        words = sentence.split()
        vowel = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']

        for i in range(len(words)):
            if words[i][0] in vowel:
                ans.append(words[i] + 'ma' + 'a' * (i + 1))
            else:
                ans.append(words[i][1:] + words[i][0] + 'ma' + 'a' * (i + 1))

        return ' '.join(ans)


if __name__ == '__main__':
    print(Solution().toGoatLatin("I speak Goat Latin"))
